var a = 1;
function one() {
  var b = 2;
  function two() {
    var c = 3;
    console.log(a, b, c);
  }
  two();
}
one();

// 模拟作用域查找
const Scope = require('./scope');

let globalScope = new Scope({ name: 'global', params: ['a'], parent: null });
let oneScope = new Scope({ name: 'one', params: ['b'], parent: globalScope });
let twoScope = new Scope({ name: 'two', params: ['c'], parent: oneScope });

let aScope = twoScope.findDefiningScope('a');
console.log('aScope.name:',aScope.name);
let bScope = twoScope.findDefiningScope('b');
console.log('bScope.name:',bScope.name);
let cScope = twoScope.findDefiningScope('c');
console.log('cScope.name:',cScope.name);
let dScope = twoScope.findDefiningScope('d');
console.log('dScope:',dScope);
